package controller;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.AbstractController;

import utils.AirTransportRepositoryManager;

public class MainController extends AbstractController {

	private AirTransportRepositoryManager repositoryManager;

	
	@Override
	protected ModelAndView handleRequestInternal(HttpServletRequest request, HttpServletResponse response) throws Exception {
		
		ModelAndView mav = new ModelAndView();
		mav.addObject("flights", repositoryManager.getFlights());
		return mav;
	}

	public AirTransportRepositoryManager getRepositoryManager() {
		return repositoryManager;
	}

	public void setRepositoryManager(AirTransportRepositoryManager repositoryManager) {
		this.repositoryManager = repositoryManager;
	}
	

	
}
